package de.backtomedieval.research;

import de.backtomedieval.R;
import de.backtomedieval.main.Game;
import de.backtomedieval.units.Archer;
import de.backtomedieval.units.Ballista;
import de.backtomedieval.units.Hoplit;
import de.backtomedieval.units.LongSwordsman;
import de.backtomedieval.units.ShortSwordsman;
import de.backtomedieval.units.Spearman;
import de.backtomedieval.units.TwoHandedSwordman;

public class Plate_Mail extends AbstractResearch {

	private static int baseResearchPoints = 2000;
	
	
	public Plate_Mail() {
		this.setBaseResearchPoints(baseResearchPoints);
	}
	
	@Override
	public String getName() {
		return Game.getString(R.string.research_plate_mail);
	}
	
	protected void onLevelUp(Technology technology) {
		technology.setTwoHandedSwordmanDefenseBonus(calculateNewTechnologyPoints(TwoHandedSwordman.getBaseDefense(), technology.getTwoHandedSwordmanDefenseBonus(),getLevel(),30));
		technology.setHoplitDefenseBonus(calculateNewTechnologyPoints(Hoplit.getBaseDefense(), technology.getHoplitDefenseBonus(),getLevel(),30));
		technology.setSpearmanDefenseBonus(calculateNewTechnologyPoints(Spearman.getBaseDefense(), technology.getSpearmanDefenseBonus(),getLevel(),30));
	}

	@Override
	public String getResearchInfo(int level) {
		String info="";
		info += Game.getString(R.string.unit_twohandedswordman) + ": " + Game.getString(R.string.defense) + " +" +calculateTechnologyPointsOfLevel(TwoHandedSwordman.getBaseDefense(), level,30)+"<br>";
		info += Game.getString(R.string.unit_spearman) + ": " + Game.getString(R.string.defense) + " +" +calculateTechnologyPointsOfLevel(Spearman.getBaseDefense(), level,30)+"<br>";
		info += Game.getString(R.string.unit_hoplit) + ": " + Game.getString(R.string.defense) + " +" + +calculateTechnologyPointsOfLevel(Hoplit.getBaseDefense(), level,30);
		return info;
	}

}
